package com.xuanyuanxinyu.compose.ui.common

import android.content.res.Configuration
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.xuanyuanxinyu.compose.theme.AppTheme
import com.xuanyuanxinyu.compose.ui.entity.Message
import com.xuanyuanxinyu.compose.ui.entity.getListData



/**
 * 可以多种风格同时预览
 */
@Preview(name = "light Mode")
@Preview(
    name = "dark Mode",
//    uiMode = Configuration.UI_MODE_NIGHT_NO,
    uiMode = Configuration.UI_MODE_NIGHT_YES,
    showBackground = true,
)
@Composable
fun previewShowMessage() {
    AppTheme() {
        Surface {
            Conversation(getListData())
        }
    }
}


@Composable
fun Conversation(messages: List<Message>) {
//    LazyRow {
//
//    }
    LazyColumn {
        items(messages) { message ->
            MessageCard(message)
        }
    }
}

